<pre class="docs-method-signature"><code>g.Path(segments)</code></pre>
<p>Return a new path object consisting of path segments provided.</p>

<p>The path returned is not guaranteed to be a valid path (i.e. its path data might not be immediately usable as a <code>d</code> attribute of an SVG DOM element). This happens when the <code>segments</code> array does not start with a Moveto segment. The <code>path.isValid()</code> <a href="#g.Path.prototype.isValid">function</a> may be used to test whether the path is valid.</p>

<p>The constructor also accepts an array of Line and/or Curve objects as an argument. Then, path segments are generated using this array. An initial Moveto segment is added, and additional Moveto segments are insterted between any two disconnected objects (the end point of one is not the start point of another).</p>

<p>It is not necessary to pass single-element arrays to the constructor; a single Segment, Line or Curve object is accepted as well.</p>

<p>Alternatively, the constructor accepts a Polyline object as an argument; Lineto path segments are generated to connect the polyline's points.</p>

<p>Finally, the constructor accepts a path data string as an argument; then the <code>g.Path.parse()</code> <a href="#g.Path.parse">function</a> is used to generate path segments.</p>
